//
//  MenuListCollectionViewCell.m
//  味·道
//
//  Created by 刘孝纯 on 15/6/30.
//  Copyright (c) 2015年 WMR. All rights reserved.
//

#import "MenuListCollectionViewCell.h"
#import <UIImageView+WebCache.h>
@implementation MenuListCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self =[super initWithFrame:frame];
    if (self) {
        _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, self.frame.size.width-20, self.frame.size.height/2+20)];
        _imageView.backgroundColor = [UIColor grayColor];
        _title = [[UILabel alloc] initWithFrame:CGRectMake(10, self.frame.size.height/2+5+20, self.frame.size.width-20, 15)];
        _content = [[UILabel alloc] initWithFrame:CGRectMake(10, self.frame.size.height/2+28+20, self.frame.size.width-20, 14)];
//        _content.numberOfLines = 0;
//        _content.textAlignment = 
        _content.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_imageView];
        [self.contentView addSubview:_title];
        [self.contentView addSubview:_content];
    }
    return self;
}
-(void)setModel:(MenuList *)model
{
    if (_model != model ) {
        [_model release];
        _model = [model retain];
    }
    [_imageView sd_setImageWithURL:[NSURL URLWithString:model.thumb] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    _imageView.layer.cornerRadius = 5;
    _imageView.layer.masksToBounds =YES;
    _title.text = model.title;
    _content.text = model.yuanliao;
}
@end
